package com.gitee.kamismile.disruptorEx.commandhandling;

public interface CommandCallback<R> {

    /**
     * Invoked when command handling execution was successful.
     *
     * @param commandMessage The message that was dispatched
     * @param result The result of the command handling execution, if any.
     */
    void onSuccess(CommandMessage commandMessage, R result);

    /**
     * Invoked when command handling execution resulted in an error.
     *
     * @param commandMessage The message that was dispatched
     * @param cause The exception raised during command handling
     */
    void onFailure(CommandMessage commandMessage, Throwable cause);
}
